<template>
    <section>
        <el-col :span="24">
            <el-form inline>
                <el-form-item>
                    <el-select v-model="form.supplier_id" filterable remote placeholder="输入搜索的工厂名称" size="small"
                               :remote-method="searchFactoryBtn" :loading="searchLoading" clearable :disabled="user.source_from=='gc'">
                        <el-option v-for="(item,index) in factoryList" :label="item.factory_name" :value="item.supplier_id" :key="index" ></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-date-picker v-model="form.recon_time" type="month" value-format="yyyy-MM" placeholder="选择月份" style="width: 140px" size="small" clearable>
                    </el-date-picker>
                </el-form-item>
                <el-form-item>
                    <el-select v-model="form.status" placeholder="审核状态" clearable size="small" style="width: 120px">
                        <el-option :value=0 label="待审核"></el-option>
                        <el-option :value=1 label="已通过"></el-option>
                        <el-option :value=2 label="未通过"></el-option>
                        <el-option :value=3 label="已作废"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-select v-model="form.pay_status" placeholder="付款状态" size="small" style="width: 120px" clearable>
                        <el-option :value=0 label="未付款"></el-option>
                        <el-option :value=1 label="已付款"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" class="el-icon-search" @click="searchBtn" size="small" :loading="btnLoading">&nbsp;查询</el-button>
                    <el-button v-if="user.source_from=='fs'" type="warning" class="el-icon-plus" @click="addVisible=true;" size="small" :loading="btnLoading">
                        &nbsp;创建采退/返修对账单</el-button>
                </el-form-item>
            </el-form>
        </el-col>
        <el-col :span="24">
            <el-table :data="data" style="width: 100%" :max-height="tableHeight" v-loading="loading" size="mini">
                <el-table-column label="品牌" prop="brand_name" width="90"></el-table-column>
                <el-table-column label="加工厂" prop="factory_name" show-overflow-tooltip></el-table-column>
                <el-table-column label="年/月" prop="recon_time"></el-table-column>
                <el-table-column label="创建人" prop="adduser"></el-table-column>
                <el-table-column label="创建时间" prop="createtime" width="140"></el-table-column>
                <el-table-column label="应付金额" align="center" prop="pay_amount">
                    <template slot-scope="{row}">
                        {{row.pay_amount}}
                        <el-tooltip v-if="row.remark" :content="row.remark" placement="top-start">
                            <i class="el-icon-warning" style="color: #E6A23C;"></i>
                        </el-tooltip>
                    </template>
                </el-table-column>
                <el-table-column label="付款凭证" prop="pay_images" width="90">
                    <template slot-scope="{ row }">
                        <el-image v-if="row.pay_images" :src="row.pay_images[0]" fit="contain" :preview-src-list="row.pay_images" style="height: 50px;">
                            <div slot="error" class="image-slot">
                                <svg t="1718681716906" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2623" width="20" height="20"><path d="M400.696 268.795c-17.249 0-31.233 13.986-31.233 31.233v30.471c0 17.249 13.986 31.233 31.233 31.233s31.233-13.986 31.233-31.233v-30.471c0-17.249-13.985-31.233-31.233-31.233z" fill="#999999" p-id="2624"></path><path d="M623.649 361.734c17.249 0 31.234-13.986 31.234-31.233v-30.471c0-17.249-13.986-31.233-31.234-31.233s-31.233 13.986-31.233 31.233v30.471c-0.001 17.248 13.985 31.233 31.233 31.233z" fill="#999999" p-id="2625"></path><path d="M438.295 388.804c-14.656 9.104-19.155 28.362-10.050 43.013 11.209 18.047 41.976 48.59 86.157 48.59 43.958 0 75.1-30.313 86.574-48.223 9.303-14.529 5.068-33.847-9.455-43.15-14.539-9.298-33.852-5.068-43.15 9.455-0.122 0.199-13.38 19.45-33.969 19.45-20.009 0-32.444-18.128-33.278-19.373-9.166-14.423-28.28-18.805-42.829-9.761z" fill="#999999" p-id="2626"></path><path d="M824.508503 116.690676 571.592236 116.690676c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c40.181141 0 72.878844 32.692586 72.878844 72.878844l0 396.966057-189.334159-165.29465c-12.20088-10.655687-30.517037-10.207479-42.173518 0.9967L468.578048 674.16231 309.521472 517.519714c-11.895935-11.70253-30.903847-12.002358-43.154869-0.645706L126.957507 646.163629l0-394.126382c0-40.186258 32.692586-72.878844 72.878844-72.878844l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352S470.000444 116.690676 452.751594 116.690676L199.836351 116.690676c-74.632791 0-135.346571 60.71378-135.346571 135.346571l0 520.56405c0 74.632791 60.71378 135.346571 135.346571 135.346571l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352s-13.985526-31.233352-31.233352-31.233352L199.836351 845.481164c-40.186258 0-72.878844-32.692586-72.878844-72.878844l0-41.23924 160.003134-148.385539 159.428036 157.007917c12.048407 11.865235 31.361265 11.981892 43.546795 0.274246l198.576661-190.68697 208.876238 182.346001 0 40.683585c0 40.186258-32.697703 72.878844-72.878844 72.878844L571.592236 845.481164c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c74.627674 0 135.346571-60.71378 135.346571-135.346571L959.855074 252.037247C959.855074 177.404456 899.136178 116.690676 824.508503 116.690676z" fill="#999999" p-id="2627"></path></svg>
                            </div>
                        </el-image>
                    </template>
                </el-table-column>
                <el-table-column label="审核状态" prop="status">
                    <template slot-scope="{ row }">
                        <el-tag size="mini" v-if="row.status==0">待审核</el-tag>
                        <el-tag size="mini" type="success" v-else-if="row.status==1">已通过</el-tag>
                        <el-tag size="mini" type="danger" v-else-if="row.status==2">未通过</el-tag>
                        <el-tag size="mini" type="info" v-else-if="row.status==3">已作废</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="推送金蝶" prop="pay_status">
                    <template slot-scope="{ row }">
                        <el-tag size="mini" type="success" v-if="row.is_push==1">已推送</el-tag>
                        <el-tag size="mini" type="info" v-else>未推送</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="付款状态" prop="pay_status">
                    <template slot-scope="{ row }">
                        <el-tag size="mini" type="success" v-if="row.pay_status==1">已付款</el-tag>
                        <el-tag size="mini" type="info" v-else>未付款</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="操作" fixed="right" width="160" v-if="user.source_from=='fs'">
                        <template slot-scope="{row}">
                            <el-button type="text" size="mini" @click="detailBtn(row.id)" class="el-icon-document">&nbsp;详情</el-button>
                        &nbsp;
                        <el-dropdown trigger="hover" style="font-size: 12px;" @command="dropdownBtn($event, row)">
                            <span style="cursor: pointer;color: #409EFF;">
                                更多操作<i class="el-icon-arrow-down el-icon--right"></i>
                            </span>
                            <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item command="CHECK_OK" icon="el-icon-check"
                                                  :disabled="!(row.status==0 && nodeActions.includes('check'))">审核通过</el-dropdown-item>
                                <el-dropdown-item command="CHECK_FAIL" icon="el-icon-close"
                                                  :disabled="!(row.status==0 && nodeActions.includes('check'))">审核未通过</el-dropdown-item>
                                <el-dropdown-item command="PAY" icon="el-icon-shopping-cart-1"
                                                  :disabled="!(row.status==1 && row.pay_status!=1 && nodeActions.includes('pay'))">付 款</el-dropdown-item>
                                <el-dropdown-item command="PUSH" icon="el-icon-position"
                                                  :disabled="!(row.status==1 && row.is_push==0 && nodeActions.includes('push'))">推 送</el-dropdown-item>
                                <el-dropdown-item command="CANCEL" icon="el-icon-delete" :disabled="!([0, 2].includes(row.status) || nodeActions.includes('cancel'))">作 废</el-dropdown-item>
                            </el-dropdown-menu>
                        </el-dropdown>
                    </template>
                </el-table-column>
                <el-table-column label="操作" fixed="right" width="80" v-else>
                    <template slot-scope="{row}">
                        <el-button type="text" size="mini" @click="detailBtn(row.id)" class="el-icon-document">&nbsp;详情</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <!--翻页栏-->
            <div style="margin-top: 4px;overflow: hidden;float: right;">
                <Page :total="total" :current="page" :page-size="limit" show-total @on-change="pageChange"></Page>
            </div>
        </el-col>

        <!--付款凭证-->
        <el-dialog title="付款凭证" :visible.sync="payVisible" :close-on-click-modal="false" :close-on-press-escape="false" :before-close="closeBtn" width="550px">
            <el-row>
                <el-upload action="/api/tool/fileImport" list-type="picture-card"
                           :headers="uploadHeaders"
                           :data="uploadData"
                           :file-list="payImages"
                           :on-success="(res, file, fileList)=>uploadSuccessHandle(res, fileList)"
                           :before-upload="beforeUploadHandle">
                    <i slot="default" class="el-icon-plus"></i>
                    <div slot="file" slot-scope="{file}">
                        <img class="el-upload-list__item-thumbnail" :src="file.url" />
                        <span class="el-upload-list__item-actions">
<!--                        <span class="el-upload-list__item-preview" @click="previewImgBtn(file)">-->
                            <!--                          <i class="el-icon-zoom-in"></i>-->
                            <!--                        </span>-->
                        <span class="el-upload-list__item-delete" @click="delImgBtn(file)">
                          <i class="el-icon-delete"></i>
                        </span>
                    </span>
                    </div>
                </el-upload>
            </el-row>
            <div slot="footer">
                <el-button @click="closeBtn" size="small" plain>退 出</el-button>
                <el-button type="primary" @click="" size="small" :loading="saveLoading" :disabled="payImages.length==0" @click="submitPayImagesBtn">确认</el-button>
            </div>
        </el-dialog>

        <!--详情-->
        <el-drawer :title="detail.factory_name+' '+detail.recon_time" :visible.sync="detailVisible" size="1200px" direction="rtl" :wrapperClosable="false" :before-close="closeBtn">
            <el-row style="padding-left: 20px;padding-bottom:20px;overflow-y:auto;" :style="{'height': drawHeight}">
                <div style="margin-top: 0px;">
                    <svg t="1717659283335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9445" width="16" height="16"><path d="M407.466667 477.866667h-277.333334C93.866667 477.866667 64 448 64 409.6v-277.333333c0-36.266667 29.866667-66.133333 66.133333-66.133334h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133334v277.333333c2.133333 38.4-27.733333 68.266667-66.133333 68.266667zM132.266667 108.8c-12.8 0-25.6 10.666667-25.6 25.6v277.333333c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333333c0-12.8-10.666667-25.6-25.6-25.6h-277.333333zM407.466667 960h-277.333334C93.866667 960 64 930.133333 64 893.866667v-277.333334c0-36.266667 29.866667-66.133333 66.133333-66.133333h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM132.266667 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z m618.666666-110.933333c-17.066667 0-34.133333-6.4-46.933333-19.2L563.2 320c-12.8-12.8-19.2-29.866667-19.2-46.933333s6.4-34.133333 19.2-46.933334L704 83.2c12.8-12.8 29.866667-19.2 46.933333-19.2 17.066667 0 34.133333 6.4 46.933334 19.2l140.8 140.8c12.8 12.8 19.2 29.866667 19.2 46.933333 0 17.066667-6.4 34.133333-19.2 46.933334l-138.666667 142.933333c-12.8 12.8-29.866667 19.2-49.066667 19.2z m0-373.333333c-6.4 0-12.8 2.133333-17.066666 6.4l-140.8 140.8c-4.266667 4.266667-6.4 10.666667-6.4 17.066666 0 6.4 2.133333 12.8 6.4 17.066667l140.8 140.8c4.266667 4.266667 10.666667 6.4 17.066666 6.4 6.4 0 12.8-2.133333 17.066667-6.4l140.8-140.8c4.266667-4.266667 6.4-10.666667 6.4-17.066667 0-6.4-2.133333-12.8-6.4-17.066666L768 113.066667c-4.266667-4.266667-8.533333-6.4-17.066667-6.4z m138.666667 853.333333h-277.333333c-36.266667 0-66.133333-29.866667-66.133334-66.133333v-277.333334c0-36.266667 29.866667-66.133333 66.133334-66.133333h277.333333c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM614.4 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z" fill="#1E87EB" p-id="9446"></path></svg>
                    <span style="font-size: 16px;font-weight: bold;vertical-align: bottom;margin-left: 4px;">回货统计单</span>
                    <div style="display: inline-block;float: right">
                        <span style="font-size: 13px;font-weight: bold">回货总金额：<span style="color: #ff7171">{{detail.purchasein_amount}}</span></span>
                        &nbsp;&nbsp;&nbsp;
                        <span style="font-size: 13px;font-weight: bold">回货总数量：<span style="color: #67C23A;">{{detail.purchasein_num}}</span></span>
                        &nbsp;&nbsp;&nbsp;
                    </div>
                </div>
                <el-table :data="detail.list" size="mini" border :header-cell-style="{ background: '#F3F4F7', color: '#555' }"
                          max-height="400px" style="width: 99%;">
                    <el-table-column prop="processing_code" label="生产加工单"></el-table-column>
                    <el-table-column prop="factory_contract_no" label="合同号" width="140"></el-table-column>
                    <el-table-column prop="po_id" label="采购通知单" width="150"></el-table-column>
                    <el-table-column prop="type_no" label="款号"></el-table-column>
                    <el-table-column prop="type_name" label="款名" show-overflow-tooltip></el-table-column>
                    <el-table-column prop="contract_price" label="大货成衣成本加价总价(含税)"></el-table-column>
                    <el-table-column prop="pay_price" label="实付成衣成本加价总价(含税)"></el-table-column>
                    <el-table-column prop="totalnum" label="数量" width="100"></el-table-column>
                    <el-table-column prop="cost_amount" label="货款金额(含税)"></el-table-column>
                </el-table>
                <div style="margin-top: 20px;">
                    <svg t="1717659283335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9445" width="16" height="16"><path d="M407.466667 477.866667h-277.333334C93.866667 477.866667 64 448 64 409.6v-277.333333c0-36.266667 29.866667-66.133333 66.133333-66.133334h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133334v277.333333c2.133333 38.4-27.733333 68.266667-66.133333 68.266667zM132.266667 108.8c-12.8 0-25.6 10.666667-25.6 25.6v277.333333c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333333c0-12.8-10.666667-25.6-25.6-25.6h-277.333333zM407.466667 960h-277.333334C93.866667 960 64 930.133333 64 893.866667v-277.333334c0-36.266667 29.866667-66.133333 66.133333-66.133333h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM132.266667 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z m618.666666-110.933333c-17.066667 0-34.133333-6.4-46.933333-19.2L563.2 320c-12.8-12.8-19.2-29.866667-19.2-46.933333s6.4-34.133333 19.2-46.933334L704 83.2c12.8-12.8 29.866667-19.2 46.933333-19.2 17.066667 0 34.133333 6.4 46.933334 19.2l140.8 140.8c12.8 12.8 19.2 29.866667 19.2 46.933333 0 17.066667-6.4 34.133333-19.2 46.933334l-138.666667 142.933333c-12.8 12.8-29.866667 19.2-49.066667 19.2z m0-373.333333c-6.4 0-12.8 2.133333-17.066666 6.4l-140.8 140.8c-4.266667 4.266667-6.4 10.666667-6.4 17.066666 0 6.4 2.133333 12.8 6.4 17.066667l140.8 140.8c4.266667 4.266667 10.666667 6.4 17.066666 6.4 6.4 0 12.8-2.133333 17.066667-6.4l140.8-140.8c4.266667-4.266667 6.4-10.666667 6.4-17.066667 0-6.4-2.133333-12.8-6.4-17.066666L768 113.066667c-4.266667-4.266667-8.533333-6.4-17.066667-6.4z m138.666667 853.333333h-277.333333c-36.266667 0-66.133333-29.866667-66.133334-66.133333v-277.333334c0-36.266667 29.866667-66.133333 66.133334-66.133333h277.333333c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM614.4 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z" fill="#1E87EB" p-id="9446"></path></svg>
                    <span style="font-size: 16px;font-weight: bold;vertical-align: bottom;margin-left: 4px;">采退返修退款统计</span>
                </div>
                <el-table :data="detail.repair_list" size="mini" border :header-cell-style="{ background: '#F3F4F7', color: '#555' }"
                          max-height="400px" style="width: 99%;">
                    <el-table-column label="生产加工单" prop="processing_code"></el-table-column>
                    <el-table-column label="采退返修单号" prop="jy_withdrawal_number"></el-table-column>
                    <el-table-column label="款号" prop="type_no"></el-table-column>
                    <el-table-column label="业务类型" align="center" prop="groups" width="90">
                        <template slot-scope="{ row }">
                            <el-tag size="mini" v-if="row.groups==1">返厂维修</el-tag>
                            <el-tag size="mini" v-else type="warning">采购退货</el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column label="大货成衣成本加价总价(含税)" prop="contract_machining_price" width="175"></el-table-column>
                    <el-table-column label="实付成衣成本加价总价(含税)" prop="pay_machining_price" width="175"></el-table-column>
                    <el-table-column label="数量" prop="num" width="100">
                        <template slot-scope="{ row }">
                            <div style="color: #f56c6c">-{{ row.num }}</div>
                        </template>
                    </el-table-column>
                    <el-table-column label="退款金额" prop="amount">
                        <template slot-scope="{ row }">
                            <div style="color: #f56c6c">-{{ row.amount }}</div>
                        </template>
                    </el-table-column>
                </el-table>
                <div style="margin-top: 20px;">
                    <svg t="1717659283335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9445" width="16" height="16"><path d="M407.466667 477.866667h-277.333334C93.866667 477.866667 64 448 64 409.6v-277.333333c0-36.266667 29.866667-66.133333 66.133333-66.133334h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133334v277.333333c2.133333 38.4-27.733333 68.266667-66.133333 68.266667zM132.266667 108.8c-12.8 0-25.6 10.666667-25.6 25.6v277.333333c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333333c0-12.8-10.666667-25.6-25.6-25.6h-277.333333zM407.466667 960h-277.333334C93.866667 960 64 930.133333 64 893.866667v-277.333334c0-36.266667 29.866667-66.133333 66.133333-66.133333h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM132.266667 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z m618.666666-110.933333c-17.066667 0-34.133333-6.4-46.933333-19.2L563.2 320c-12.8-12.8-19.2-29.866667-19.2-46.933333s6.4-34.133333 19.2-46.933334L704 83.2c12.8-12.8 29.866667-19.2 46.933333-19.2 17.066667 0 34.133333 6.4 46.933334 19.2l140.8 140.8c12.8 12.8 19.2 29.866667 19.2 46.933333 0 17.066667-6.4 34.133333-19.2 46.933334l-138.666667 142.933333c-12.8 12.8-29.866667 19.2-49.066667 19.2z m0-373.333333c-6.4 0-12.8 2.133333-17.066666 6.4l-140.8 140.8c-4.266667 4.266667-6.4 10.666667-6.4 17.066666 0 6.4 2.133333 12.8 6.4 17.066667l140.8 140.8c4.266667 4.266667 10.666667 6.4 17.066666 6.4 6.4 0 12.8-2.133333 17.066667-6.4l140.8-140.8c4.266667-4.266667 6.4-10.666667 6.4-17.066667 0-6.4-2.133333-12.8-6.4-17.066666L768 113.066667c-4.266667-4.266667-8.533333-6.4-17.066667-6.4z m138.666667 853.333333h-277.333333c-36.266667 0-66.133333-29.866667-66.133334-66.133333v-277.333334c0-36.266667 29.866667-66.133333 66.133334-66.133333h277.333333c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM614.4 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z" fill="#1E87EB" p-id="9446"></path></svg>
                    <span style="font-size: 16px;font-weight: bold;vertical-align: bottom;margin-left: 4px;">对账信息汇总</span>
                </div>
                <el-table :data="detail.info" size="mini" border :header-cell-style="{ background: '#F3F4F7', color: '#555' }"
                          max-height="400px" style="width: 99%;">
                    <el-table-column label="货款金额" prop="purchasein_amount"></el-table-column>
                    <el-table-column label="采退返修退款金额" prop="repair_amount"></el-table-column>
                    <el-table-column label="总应付金额" prop="pay_amount"></el-table-column>
                </el-table>
                <div style="margin-top: 20px;">
                    <svg t="1717659283335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9445" width="16" height="16"><path d="M407.466667 477.866667h-277.333334C93.866667 477.866667 64 448 64 409.6v-277.333333c0-36.266667 29.866667-66.133333 66.133333-66.133334h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133334v277.333333c2.133333 38.4-27.733333 68.266667-66.133333 68.266667zM132.266667 108.8c-12.8 0-25.6 10.666667-25.6 25.6v277.333333c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333333c0-12.8-10.666667-25.6-25.6-25.6h-277.333333zM407.466667 960h-277.333334C93.866667 960 64 930.133333 64 893.866667v-277.333334c0-36.266667 29.866667-66.133333 66.133333-66.133333h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM132.266667 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z m618.666666-110.933333c-17.066667 0-34.133333-6.4-46.933333-19.2L563.2 320c-12.8-12.8-19.2-29.866667-19.2-46.933333s6.4-34.133333 19.2-46.933334L704 83.2c12.8-12.8 29.866667-19.2 46.933333-19.2 17.066667 0 34.133333 6.4 46.933334 19.2l140.8 140.8c12.8 12.8 19.2 29.866667 19.2 46.933333 0 17.066667-6.4 34.133333-19.2 46.933334l-138.666667 142.933333c-12.8 12.8-29.866667 19.2-49.066667 19.2z m0-373.333333c-6.4 0-12.8 2.133333-17.066666 6.4l-140.8 140.8c-4.266667 4.266667-6.4 10.666667-6.4 17.066666 0 6.4 2.133333 12.8 6.4 17.066667l140.8 140.8c4.266667 4.266667 10.666667 6.4 17.066666 6.4 6.4 0 12.8-2.133333 17.066667-6.4l140.8-140.8c4.266667-4.266667 6.4-10.666667 6.4-17.066667 0-6.4-2.133333-12.8-6.4-17.066666L768 113.066667c-4.266667-4.266667-8.533333-6.4-17.066667-6.4z m138.666667 853.333333h-277.333333c-36.266667 0-66.133333-29.866667-66.133334-66.133333v-277.333334c0-36.266667 29.866667-66.133333 66.133334-66.133333h277.333333c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM614.4 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z" fill="#1E87EB" p-id="9446"></path></svg>
                    <span style="font-size: 16px;font-weight: bold;vertical-align: bottom;margin-left: 4px;">工厂银行信息</span>
                </div>
                <el-table :data="detail.bank" size="mini" border :header-cell-style="{ background: '#F3F4F7', color: '#555' }"
                          max-height="400px" style="width: 99%;">
                    <el-table-column label="公司抬头" prop="company_head"></el-table-column>
                    <el-table-column label="开户行" prop="bank_of_deposit"></el-table-column>
                    <el-table-column label="开户行号" prop="opening_bank_no"></el-table-column>
                    <el-table-column label="银行账户" prop="bank_account"></el-table-column>
                </el-table>
            </el-row>
            <div style="width: 100%;position: absolute;bottom: 10px;padding: 8px;border-top: 1px #ebeef5 solid;">
                <el-button type="primary" @click="downloadPdfBtn(detail.id)" plain>
                    <svg style="vertical-align: bottom;" t="1726624575172" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4612" width="16" height="16"><path d="M192 384h640a42.666667 42.666667 0 0 1 42.666667 42.666667v362.666666a42.666667 42.666667 0 0 1-42.666667 42.666667H192v106.666667a21.333333 21.333333 0 0 0 21.333333 21.333333h725.333334a21.333333 21.333333 0 0 0 21.333333-21.333333V308.821333L949.909333 298.666667h-126.528A98.048 98.048 0 0 1 725.333333 200.618667V72.661333L716.714667 64H213.333333a21.333333 21.333333 0 0 0-21.333333 21.333333v298.666667zM128 832H42.666667a42.666667 42.666667 0 0 1-42.666667-42.666667V426.666667a42.666667 42.666667 0 0 1 42.666667-42.666667h85.333333V85.333333a85.333333 85.333333 0 0 1 85.333333-85.333333h530.026667L1024 282.453333V938.666667a85.333333 85.333333 0 0 1-85.333333 85.333333H213.333333a85.333333 85.333333 0 0 1-85.333333-85.333333v-106.666667zM88.469333 472.490667V746.666667h44.928v-105.216h67.968c66.816 0 100.224-28.416 100.224-84.864 0-56.064-33.408-84.096-99.456-84.096H88.469333z m44.928 38.4h65.28c19.584 0 34.176 3.456 43.392 10.752 9.216 6.912 14.208 18.432 14.208 34.944 0 16.512-4.608 28.416-13.824 35.712-9.216 6.912-23.808 10.752-43.776 10.752h-65.28v-92.16z m206.592-38.4V746.666667h100.224c44.544 0 77.952-12.288 100.992-36.864 21.888-23.424 33.024-56.832 33.024-100.224 0-43.776-11.136-77.184-33.024-100.224-23.04-24.576-56.448-36.864-100.992-36.864h-100.224z m44.928 38.4h46.848c34.176 0 59.136 7.68 74.88 23.424 15.36 15.36 23.04 40.704 23.04 75.264 0 33.792-7.68 58.752-23.04 74.88-15.744 15.744-40.704 23.808-74.88 23.808h-46.848v-197.376z m231.552-38.4V746.666667h44.928v-121.344h134.016v-38.4h-134.016v-76.032h142.08v-38.4h-187.008z" fill="#EA4318" p-id="4613"></path></svg>
                    导出PDF
                </el-button>
                <el-button type="primary" @click="downloadExcelBtn(detail.id)" plain>
                    <svg style="vertical-align: bottom;" t="1726296940186" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4414" width="16" height="16"><path d="M595.2 755.2h128v88.32L954.88 710.4 723.2 576v89.6h-128zM266.24 134.4c0-6.4 6.4-12.8 12.8-12.8H652.8c3.84 0 7.68 0 12.8 1.28v198.4H864c1.28 5.12 1.28 29.44 1.28 33.28v252.16l49.92 30.72v-281.6c0-34.56-20.48-102.4-43.52-126.72L760.32 117.76C736 93.44 688.64 74.24 654.08 74.24H279.04c-34.56 0-62.72 28.16-62.72 62.72V262.4h49.92v-128z m449.28 10.24c3.84 2.56 6.4 5.12 8.96 7.68l111.36 111.36c2.56 2.56 5.12 5.12 7.68 8.96h-128v-128z" fill="#22975D" p-id="4415"></path><path d="M595.2 385.28H800v58.88H595.2z m270.08 503.04c0 6.4-6.4 12.8-12.8 12.8H279.04c-6.4 0-12.8-6.4-12.8-12.8v-42.24h-49.92v42.24c0 34.56 28.16 62.72 62.72 62.72h574.72c34.56 0 62.72-28.16 62.72-62.72V783.36l-49.92 29.44v75.52zM537.6 320H69.12v468.48H537.6V320zM367.36 687.36l-64-94.72-28.16 43.52h28.16v52.48H160l104.96-153.6L172.8 396.8h76.8l55.04 80.64 55.04-80.64h76.8l-92.16 138.24 104.96 153.6h-81.92z m227.84-185.6H800v58.88H595.2z" fill="#22975D" p-id="4416"></path></svg>
                    导出Excel
                </el-button>
            </div>
        </el-drawer>

        <!--新增对账单-->
        <el-drawer title="创建采退/返修对账单" :visible.sync="addVisible" size="1200px" direction="rtl" :wrapperClosable="false" :before-close="closeBtn">
            <el-row style="padding-left: 20px;">
                <el-tabs type="border-card" v-model="tab" style="width: 99%">
                    <el-form inline>
                        <el-form-item>
                            <el-select v-model="addForm.supplier_id" filterable remote placeholder="输入搜索的工厂名称" size="small" :disabled="step!=1"
                                       :remote-method="searchFactoryBtn" :loading="searchLoading" clearable @change="repairList">
                                <el-option v-for="(item,index) in factoryList" :label="item.factory_name" :value="item.supplier_id" :key="index" ></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item>
                            <el-date-picker v-model="addForm.recon_time" @change="repairList" type="month" value-format="yyyy-MM" placeholder="选择月份" style="width: 140px" size="small" clearable
                                            :disabled="step!=1">
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item>
                            <el-select size="small" v-model="addForm.brand_code" placeholder="品牌" style="width: 100px" clearable @change="repairList" :disabled="step!=1">
                                <el-option value="S" label="十三余"></el-option>
                                <el-option value="Y" label="有香如故"></el-option>
                                <el-option value="XM" label="一弦一木"></el-option>
                                <el-option value="J" label="锦瑟"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item v-if="step==1">
                            <el-select size="small" v-model="addForm.k_status" placeholder="是否抵扣" style="width: 100px" clearable @change="repairList">
                                <el-option :value=0 label="未抵扣"></el-option>
                                <el-option :value=2 label="已抵扣"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-form>
                    <el-tab-pane label="采退/返修明细" name="repairs" disabled>
                        <el-table :data="repairData" style="width: 100%" :max-height="drawHeight2" v-loading="addLoading" size="mini" @selection-change="repairSelected">
                            <el-table-column type="selection" width="55" :selectable="selectable"></el-table-column>
                            <el-table-column label="加工单号" prop="processing_code"></el-table-column>
                            <el-table-column label="采退返修单号" prop="jy_withdrawal_number" width="120" show-overflow-tooltip></el-table-column>
                            <el-table-column label="款号" prop="type_no" width="120"></el-table-column>
                            <el-table-column label="工厂" prop="factory_name" show-overflow-tooltip></el-table-column>
                            <el-table-column label="成衣成本加价总价(大货)" prop="contract_machining_price" width="90"></el-table-column>
                            <el-table-column label="成衣成本加价总价(实付)" prop="pay_machining_price" width="90"></el-table-column>
                            <el-table-column label="数量" align="center" prop="num">
                                <template slot-scope="{ row }">
                                    <div style="color:#f56c6c">-{{ row.num }}</div>
                                </template>
                            </el-table-column>
                            <el-table-column label="返修退款金额" prop="amount" width="100">
                                <template slot-scope="{ row }">
                                    <div style="color: #f56c6c">-{{ row.amount }}</div>
                                </template>
                            </el-table-column>
                            <el-table-column label="业务类型" align="center" prop="groups" width="90">
                                <template slot-scope="{ row }">
                                    <el-tag size="mini" v-if="row.groups==1">返厂维修</el-tag>
                                    <el-tag size="mini" v-else type="warning">采购退货</el-tag>
                                </template>
                            </el-table-column>
                            <el-table-column label="状态" align="center" prop="k_status" width="70">
                                <template slot-scope="{ row }">
                                    <el-tag size="mini" type="success" v-if="row.k_status==2">已抵扣</el-tag>
                                    <el-tag size="mini" type="info" v-else>未抵扣</el-tag>
                                </template>
                            </el-table-column>
                            <el-table-column label="创建时间" prop="createtime" width="150"></el-table-column>
                        </el-table>
                    </el-tab-pane>
                    <el-tab-pane label="回货统计单" name="returns" disabled>
                        <el-table :data="returnData" style="width: 100%" :max-height="drawHeight2" v-loading="addLoading" size="mini" @selection-change="returnSelected">
                            <el-table-column type="selection" width="55"></el-table-column>
                            <el-table-column label="加工单号" prop="processing_code" width="150"></el-table-column>
                            <el-table-column label="采购单号" prop="po_id" width="150"></el-table-column>
                            <el-table-column label="款号" prop="type_no" width="130"></el-table-column>
                            <el-table-column label="成衣大货单价" prop="contract_price" width="95"></el-table-column>
                            <el-table-column label="成衣实付单价" prop="pay_price" width="95"></el-table-column>
                            <el-table-column label="数量" prop="totalnum" width="80"></el-table-column>
                            <el-table-column label="货款金额（含税）" prop="cost_amount" width="120"></el-table-column>
                            <el-table-column label="加工厂" prop="factory_name" show-overflow-tooltip></el-table-column>
                        </el-table>
                    </el-tab-pane>
                </el-tabs>
            </el-row>
            <div style="width: 100%;position: absolute;bottom: 10px;padding: 8px;border-top: 1px #ebeef5 solid;">
                <el-button v-if="step==1" type="primary" @click="nextBtn" plain
                           :disabled="!(repairSelectedData.length!=0 || (addForm.supplier_id&&addForm.recon_time&&addForm.brand_code))">下一步</el-button>
                <el-button v-if="step!=1" type="primary" @click="step=1;tab='repairs'" plain>上一步</el-button>
                <el-button v-if="step!=1" type="primary" @click="createBtn" :loading="btnLoading">{{btnLoading ? "创建中..." : "创建采退/返修对账单"}}</el-button>
            </div>
        </el-drawer>
    </section>
</template>

<script>

import {factoryList} from "@/api/produce/factory";
import {formatDate} from "@/libs/tools";
import {
    repairList,
    repairMCancel,
    repairMCheck,
    repairMCreate,
    repairMDetail,
    repairMList,
    repairMPayImages, repairMPush
} from "@/api/soa/repair";
import {getToken} from "@/libs/util";
import {cyStatisticList} from "@/api/soa/cyStatistic";

export default {
    name: "soa_cy_repairM",
    data() {
        return {
            tableHeight: window.innerHeight - 210,
            selectIndex: 0,
            btnLoading: false,
            loading: false,
            page: 1,
            limit: 20,
            total: 0,
            data: [],
            user: {},
            nodeActions: [],

            form: {supplier_id: "", recon_time: formatDate(new Date().getTime(), "last_month"),status: 0, pay_status: ""},
            searchLoading: false,
            factoryList: [],

            payVisible: false,
            saveLoading: false,
            selectedId: "",
            payImages: [],
            uploadHeaders: {},
            uploadData:{type: 'soa_cy_repairM', disk: 'image'},

            detail: {list: [], repair_list: [], info: [], bank: []},
            detailVisible: false,
            drawHeight: window.innerHeight - 150+"px",
            drawHeight2: window.innerHeight - 270+"px",

            addVisible: false,
            addLoading: false,
            step: 1,
            tab: "repairs",
            repairData: [],
            repairSelectedData: [],
            returnData: [],//回货统计表数据
            returnSelectedData: [],
            addForm: {supplier_id: "", recon_time: formatDate(new Date().getTime(), "last_month"), k_status: 0, brand_code: ""},
        }
    },
    created() {
        this.user = this.$store.getters.user;
        this.nodeActions = this.user.node_actions[this.$route.meta.id] ? this.user.node_actions[this.$route.meta.id] : [];
        if(this.user.source_from == 'gc'){//用户来源：工厂
            this.form.supplier_id = this.user.supplier_id;
            this.form.status = 1;
        }
    },
    methods: {
        //搜索加工厂
        searchFactoryBtn(val){
            if(val == ""){
                return;
            }
            this.getFactoryData(val);
        },
        getFactoryData(name){
            factoryList({page: 1, limit: 200, tab: 1, factory_name: name, status: 0}).then((res) =>{
                this.factoryList = res.data.data;
            })
        },
        //搜索按钮
        searchBtn() {
            this.page = 1;
            this.getData();
        },
        //翻页
        pageChange(page) {
            this.page = page;
            this.getData();
        },
        //获取数据
        getData() {
            let param = {
                page: this.page,
                limit: this.limit
            };
            param = Object.assign(param, this.form);
            this.loading = true;
            repairMList(param).then((res) => {
                this.loading = false;
                this.total = res.data.total;
                this.data = res.data.data;
            }).catch(() => {
                this.loading = false;
            });
        },
        //操作按钮
        dropdownBtn(command, row){
            switch (command) {
                case "CHECK_OK":
                    this.$confirm("【通过】该返修退款对账单: "+row.factory_name+" "+row.pay_amount+" ,再次确认", "提示", {
                        confirmButtonText: "确定",
                        cancelButtonText: "取消",
                        type: "warning",
                    }).then(() => {
                        this.loading = true;
                        repairMCheck({id: row.id, status: 1}).then((res) =>{
                            this.loading = false;
                            if (res.code === 0) {
                                this.$message.success("操作成功");
                                this.getData();
                            } else {
                                this.$message.error(res.msg);
                            }
                        }).catch(() => {
                            this.loading = false;
                        })
                    }).catch(() =>{

                    })
                    break;
                case "CHECK_FAIL":
                    this.$confirm("【拒绝】该返修退款对账单: "+row.factory_name+" "+row.pay_amount+" ,再次确认", "提示", {
                        confirmButtonText: "确定",
                        cancelButtonText: "取消",
                        type: "warning",
                    }).then(() => {
                        this.loading = true;
                        repairMCheck({id: row.id, status: 2}).then((res) =>{
                            this.loading = false;
                            if (res.code === 0) {
                                this.$message.success("操作成功");
                                this.getData();
                            } else {
                                this.$message.error(res.msg);
                            }
                        }).catch(() => {
                            this.loading = false;
                        })
                    }).catch(() =>{

                    })
                    break;
                case "PAY":
                    this.selectedId = row.id;
                    this.payVisible = true;
                    break;
                case "PUSH":
                    this.$confirm("【采退/返修对账单】推送金蝶, 请确认数据是否正确?", "提示", {
                        confirmButtonText: "确定",
                        cancelButtonText: "取消",
                        type: "warning",
                    }).then(() => {
                        this.loading = true;
                        repairMPush({id: row.id}).then((res) =>{
                            this.loading = false;
                            if(res.code === 0){
                                this.$Message.success("推送成功");
                                this.getData();
                            }else{
                                this.$Message.error(res.msg);
                            }
                        }).catch(()=>{
                            this.loading = false;
                        })
                    }).catch(() => {

                    })
                    break;
                case "CANCEL":
                    this.$confirm("此操作将永久作废该对账单, 请再次确认", "提示", {
                        confirmButtonText: "确定",
                        cancelButtonText: "取消",
                        type: "warning",
                    }).then(() => {
                        let obj = {id: row.id};
                        this.loading = true;
                        repairMCancel(obj).then((res) => {
                            this.loading = false;
                            if (res.code === 0) {
                                this.$message.success("作废成功");
                                this.getData();
                            } else {
                                this.$message.error(res.msg);
                            }
                        }).catch(() => {
                            this.loading = false;
                        })
                    }).catch(() =>{

                    })
                    break;
            }
        },
        closeBtn(){
            this.step = 1;
            this.tab = "repairs";
            this.repairData = [];
            this.repairSelectedData = [];
            this.returnData = [];
            this.returnSelectedData = [];
            this.selectedId = "";
            this.payImages = [];
            this.detail = {list: [], repair_list: [], info: [], bank: []};
            this.payVisible = false;
            this.detailVisible = false;
            this.addVisible = false;
        },
        submitPayImagesBtn(){
            if(this.payImages.length==0 || !this.selectedId){
                this.$message.warning("请上传图片");
                return;
            }
            let images = [];
            this.payImages.forEach(item => {
                images.push(item.response.data);
            });
            this.saveLoading = true;
            repairMPayImages({id: this.selectedId, images: images}).then((res) =>{
                this.saveLoading = false;
                if(res.code === 0){
                    this.$message.success("付款凭证上传成功");
                    this.closeBtn();
                    this.getData();
                }else{
                    this.$message.error(res.msg);
                }
            }).catch(()=>{
                this.saveLoading = false;
            })
        },
        //详情
        detailBtn(id){
            this.loading = true;
            repairMDetail({id: id}).then((res) =>{
                this.loading = false;
                this.detail = res.data;
                this.detailVisible = true;
            }).catch(() => {
                this.loading = false;
            });
        },
        //导出pdf
        downloadPdfBtn(id){
            this.$confirm("导出pdf, 是否继续？", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                window.open(`/api/tool/fileExport?type=pdf&name=返修对账单&path=${id}`, "_blank");
            }).catch(()=>{

            })
        },
        //导出excel
        downloadExcelBtn(id){
            this.$confirm("导出excel, 是否继续？", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                window.open(`/api/tool/fileExport?type=excel&name=返修对账单&path=${id}`, "_self");
            }).catch(() => {

            })
        },
        //对复选框禁用
        selectable(row, rowIndex){
            if(row.k_status == 2){
                return false;
            }else{
                return true;
            }
        },
        //获取采退返修明细
        repairList(){
            if(!this.addForm.supplier_id || ![0, 2].includes(this.addForm.k_status) || !this.addForm.brand_code || !this.addForm.recon_time){
                return;
            }
            let param = Object.assign({page: 1, limit: 1000}, this.addForm);
            this.addLoading = true;
            repairList(param).then((res) =>{
                this.addLoading = false;
                this.repairData = res.data.data;
            })
        },
        //勾选采退、返修明细
        repairSelected(val){
            this.repairSelectedData = val;
        },
        returnSelected(val){
            this.returnSelectedData = val;
        },
        //下一步
        nextBtn(){
            this.step = 2;
            this.tab = "returns";
            this.addLoading = true;
            let param = {
                page: 1,
                limit: 1000,
                date: this.addForm.recon_time,
                brand_code: this.addForm.brand_code,
                supplier_id: this.addForm.supplier_id,
                processing_code: "FC"
            };
            cyStatisticList(param).then((res) => {
                this.addLoading = false;
                this.returnData = res.data.data;
            })
        },
        //创建采退返修对账单
        createBtn(){
            let obj = {
                date: this.addForm.recon_time,
                supplier_id: this.addForm.supplier_id,
                brand_code: this.addForm.brand_code,
                repair_ids: [],
                return_ids: [],
            };
            this.repairSelectedData.forEach(item => {
                obj.repair_ids.push(item.id);
            })
            this.returnSelectedData.forEach(item => {
                obj.return_ids.push(item.id);
            })
            this.$confirm(`即将生成${obj.date}的采退/返修对账单`, "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                this.btnLoading = true;
                repairMCreate(obj).then((res) =>{
                    this.btnLoading = false;
                    if(res.code === 0){
                        this.$message.success("采退/返修对账单, 创建成功");
                        this.closeBtn();
                        this.getData();
                    }else{
                        this.$message.error(res.msg);
                    }
                }).catch(()=>{
                    this.btnLoading = false;
                })
            }).catch(() => {

            })
        },

        //删除图片
        delImgBtn(file){
            let index;
            for(let i in this.payImages){
                if(this.payImages[i].uid == file.uid){
                    index = i;
                    break;
                }
            }
            if(index != undefined){
                this.payImages.splice(index, 1);
            }
        },
        //上传之前的检测
        beforeUploadHandle(file) {
            if(!['image/jpg','image/jpeg','image/png'].includes(file.type)){
                this.$message.error('上传图片只能是 jpg、png 格式!');
                return false;
            }
            this.uploadHeaders.Authorization = 'Bearer '+ getToken();
            return true;
        },
        //上传成功
        uploadSuccessHandle(res, fileList) {
            if(res.code === 0){
                this.payImages = fileList
            }else{
                this.$message.error("上传失败");
                fileList = fileList.filter(item => item.response && item.response.code === 0);
                this.payImages = fileList;
            }
        },
    },
    mounted() {
        this.getFactoryData("");
        this.searchBtn();
    }
}
</script>

<style scoped>
.el-image /deep/ .el-icon-circle-close:before{
    color: white;
}
</style>
